
#include "PackCmdDefine_BQ20Z459.h"

/* if using Imitating Pack Data, which can work normally without any NBPC Pack, should be set "1".  */
#define _Imitate_PackData_      ( 0 )

/////////////////////////////////////////////
// System Struct define
/////////////////////////////////////////////
#define Pack_Data_Buffer_SIZE  Max_Pack_Data_Size
#define Retry_Attempts    3

#define NumOfParallelPacks   6
enum Pack_Name
{
  _A,
  _B,
  _C,
  _D,
  _E,
  _F
};
#define NumOfSerialModules   3
enum Module_Name
{
  _M1,  //Low Level SerialModules
  _M2,  //Middle Level SerialModules
  _M3   //High Level SerialModules
};

#define _PackCommunctionMaxFailTimes_    3  //set 2 =read 3 times, if packCommunctionFailTimes > this define , regarded as change pack.
#define _PackSNDifferentMaxFailTimes_    3  //set 2 =read 3 times, if packSNDifferentTimes > this define , regarded as set pack to new SN data.
#define _PackInfoFailMaxFailTimes_        3  //set 2 =read 3 times, if PackInfoFailMaxFailTimes > this define , regarded as set pack to new infor data.

typedef struct {
  unsigned char packInfo[lastOfCmdIndex][Pack_Data_Buffer_SIZE]; 
  unsigned char packInfoFail[lastOfCmdIndex];  
  unsigned char packInfoFailTimes[lastOfCmdIndex]; 
  unsigned char packCommunctionFailTimes; //if Communction Fail many times then set packFail
  unsigned char packSNDifferentTimes; //if pack SN differnetmany times then set pack to new SN data
  unsigned char packFail;
  unsigned char isPackSealed;
  unsigned char AccessDataCmd; // for ManufacturerAccess showing data
} PackSet;

typedef struct {
  PackSet pack[NumOfParallelPacks]; 
  //char moduleInfoFail;
} ModuleSet;

enum Pack_Information_Codes
{
  PackNormal,
  PackAbnormalStatus,
  PackDataFail,
  PackCommunctionFail,
  PackAccessSealedDataFail,
  
  PackAccessUnSealed,
  PackAccessSealed,
  PackInitUnKnowFail
};

